<!DOCTYPE html>
<style>
:root {
     border-collapse: collapse;
     border-spacing: 1px;
}
.cell {
     display: table-cell;
     border: solid black;
}
.pre {
     white-space: pre;
     border: solid blue;
}
.table {
     display: inline-table;
}
</style>
<span class="pre"> <span class="table"><span class="cell">A</span>
<span class="cell">B</span></span> </span>

